package com.cdtye.itps.cms.service.datasysn;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cdtye.common.mybatiscore.base.BaseService;
import com.cdtye.itps.cms.dao.defect.entity.JcwDefectInfoPhoto;
import com.cdtye.itps.cms.mapper.defect.JcwDefectInfoPhotoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JcjcDefectInfoPhotoService extends BaseService<JcwDefectInfoPhotoMapper, JcwDefectInfoPhoto> {

    @Autowired
    private JcwDefectInfoPhotoMapper jcwDefectInfoPhotoMapper;

    @DS("tmis")
    public boolean insertDefectInfoPhotoTmis(List<JcwDefectInfoPhoto> jdiList){
        return this.saveOrUpdateBatch(jdiList);
    }

    @DS("tmis")
    public List<JcwDefectInfoPhoto> selectDefectInfoPhotoTmis(String defectInfoId){
        QueryWrapper<JcwDefectInfoPhoto> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("defect_info_id", defectInfoId);
        return jcwDefectInfoPhotoMapper.selectList(queryWrapper);
    }

}
